home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19981211-19990422 / 000347_news@watsun.cc.columbia.edu _Thu Mar 11 19:07:03 1999.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@watsun.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id TAA23645
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Thu, 11 Mar 1999 19:07:02 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id SAA19689
  7.     for kermit.misc@watsun.cc.columbia.edu; Thu, 11 Mar 1999 18:51:09 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: C-Kermit Scripting using INPUT and LOG SESSION
  11. Date: 11 Mar 1999 23:51:06 GMT
  12. Organization: Columbia University
  13. Message-ID: <7c9kta$j76$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@mailrelay2.cc.columbia.edu
  15.  
  16. In article <36e84d39.0@amhnt2.amherst.edu>,  <jwmanly+news@amherst.edu> wrote:
  17. : Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
  18. : : : Why the necessity for the INPUT line? I assume it is to force
  19. : : : C-Kermit to somehow "consume" or "process" the information, but is there
  20. : : : any other, cleaner way to do that?
  21. : :
  22. : : No.  You have to think of INPUT as an analog for your eyes and brain.  If
  23. : : you were in CONNECT mode, you'd watch the stuff coming in, and eventually
  24. : : you would see something that tells you it's done.  No INPUT, no eyes (and
  25. : : no brain :-)
  26. : Got it.  So how does LOG SESSION fit into this?  That is, at what point does
  27. : material coming in get written to the log file -- when it hits the DEVICE
  28. : buffer, or when it gets moved from that buffer to the INPUT buffer?
  29. Whenever C-Kermit reads from the device (really, from the device driver's
  30. buffer) while in CONNECT mode or executing an INPUT command, and a session log
  31. is active, it also writes the character to the session log.  (There are a
  32. few more wrinkles during CONNECT mode, depending on your SET SESSION-LOG
  33. preferences.)
  34.  
  35. : : : Final question: notice how I put that "INPUT 10 </html>" command at the
  36. : : : end of the script to flush out whatever other data comes back from the
  37. : : : remote server following the part that I am intersted in?  If I don't do
  38. : : : this, when I hit the EXIT at the end of the script (even though it
  39. : : : follows the HANGUP command), I get the "There may still be a connection
  40. : : : open, OK to exit?"  message when the script finishes.  I assume this is
  41. : : : because there is "unconsumed" data in the buffer.
  42. : :
  43. : : It's because the connection is still open, just like it says.  The server
  44. : : closes the connection after all the data it sent has been acknowledged
  45. : : (at the TCP level).
  46. : And it's not acknowledged until it has been moved to the INPUT buffer by an
  47. : INPUT command?  Got it.  This would seem to suggest some usefulness to some
  48. : kind of FLUSH or PAUSE-WHILE-FLUSHING command -- you know, pause for 2
  49. : seconds and discard anything that comes in during that time.
  50. :
  51. PAUSE 2
  52. CLEAR DEVICE
  53.  
  54.  
  55. : I've sometimes
  56. : wanted to do that in the middle of a script, and doing a bogus "INPUT 2
  57. : XXXXX" seems a bit kludgy.
  58.  
  59. Can you think of something that would be less kludgey?  "Flush everything
  60. that comes in the next 2 seconds" is totally nondeterministic.
  61.  
  62. : While we're at it, some TELNET clients have a function (usually bound to a
  63. : key) that does a "send mark and then flush to mark" function -- often called
  64. : abort output.  Does Kermit have anything like this that can be used from a
  65. : script?
  66. The next release will have a TELOPT command that lets you send any Telnet
  67. protocol command to the Telnet server.
  68.  
  69. : : : How do I tell Kermit to drop the
  70. : : : connection regardless of whether there is anything left in the buffer or
  71. : : : not, even if data is still streaming in?
  72. : : : 
  73. : : Like it says in the book:
  74. : :   SET EXIT WARNING OFF
  75. : Hmmm.  So HANGUP just tells the other end to close down, but doesn't actually
  76. : close the connection.
  77. :
  78. A network connection *is* closed by HANGUP.
  79.  
  80. : There's no straightforward way to tell Kermit to
  81. : tell the other side to close down and wait for some number of seconds to see
  82. : if the TCP connection is actually closed by the remote side?
  83. I wouldn't say that.  HANGUP does this on a network connection.  C-Kermit 7.0
  84. has a CLOSE command ("CLOSE" by itself) that closes the connection.  But it
  85. just does what HANGUP does now on a network connection.
  86.  
  87. - Frank